]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Don't show workspace switcher when it doesn't make sense
authorSeif Lotfy <seif.lotfy@collabora.co.uk>
Fri, 19 Oct 2012 11:55:18 +0000 (13:55 +0200)
committerSeif Lotfy <seif@lotfy.com>
Fri, 19 Oct 2012 23:39:52 +0000 (01:39 +0200)
Hide workspace switcher if dynamic workspaces is disabled and number of
workspaces is set to one only, since the user is bound to only one workspace
and showing the switcher is redundant.

Signed-off-by: Seif Lotfy <seif@lotfy.com>
js/ui/workspacesView.js

index edb636b09a2e9668634e4042850f892752837c45..3832efaefad8929f6d053faf5d9d4d469fef1c12 100644 (file)
@@ -541,6 +541,16 @@ const WorkspacesDisplay = new Lang.Class({
         this._notifyOpacityId = 0;
         this._swipeScrollBeginId = 0;
         this._swipeScrollEndId = 0;
+
+        this._settings = new Gio.Settings({ schema: OVERRIDE_SCHEMA });
+        this._settings.connect('changed::dynamic-workspaces',
+            Lang.bind(this, this._updateSwitcherVisibility));
+    },
+
+    _updateSwitcherVisibility: function() {
+        this._thumbnailsBox.actor.visible =
+            this._settings.get_boolean('dynamic-workspaces') ||
+                global.screen.n_workspaces > 1;
     },
 
     show: function() {
@@ -563,6 +573,7 @@ const WorkspacesDisplay = new Lang.Class({
 
         this._controls.show();
         this._thumbnailsBox.show();
+        this._updateSwitcherVisibility();
 
         this._updateWorkspacesViews();
 
@@ -974,6 +985,7 @@ const WorkspacesDisplay = new Lang.Class({
         for (let i = 0; i < this._workspacesViews.length; i++)
             this._workspacesViews[i].updateWorkspaces(oldNumWorkspaces,
                                                       newNumWorkspaces);
+        this._updateSwitcherVisibility();
     },
 
     _updateZoom : function() {